import { Queue } from "../Queue";
import { Graph } from "./Graph";


// 当要标注已经访问过的顶点时，我们用三种颜色来反映它们的状
enum Colors {
    WHITE = 0, //表示该顶点还没被访问
    GREY = 1,  //表示该顶点被访问过，但并未被探索过
    BLACK = 2  //表示该顶点被访问过且被完全探索过
}

const initializeColor = vertices => {
    const color = {};
    for (let i = 0; i < vertices.length; i++) {
        color[vertices[i]] = Colors.WHITE;
    }
    return color;
}

const breadthFirstSearch = (graph: Graph, call: Function) => {
    const vertices = graph.getVertices();
    const adjList = graph.getAdjList();
    const color = initializeColor(vertices);
    const queue = new Queue();
    queue.enqueue(vertices);
}